home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / Direct3D / DXTex / dxtexdoc.h < prev    next >
C/C++ Source or Header  |  2001-10-08  |  4KB  |  105 lines

  1. // dxtexDoc.h : interface of the CDxtexDoc class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_DXTXDOC_H__712C53CF_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_)
  6. #define AFX_DXtxDOC_H__712C53CF_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12.  
  13. class CDxtexDoc : public CDocument
  14. {
  15. protected: // create from serialization only
  16.     CDxtexDoc();
  17.     DECLARE_DYNCREATE(CDxtexDoc)
  18.  
  19. public:
  20. // Overrides
  21.     // ClassWizard generated virtual function overrides
  22.     //{{AFX_VIRTUAL(CDxtexDoc)
  23.     public:
  24.     virtual BOOL OnNewDocument();
  25.     virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
  26.     virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
  27.     virtual void SetPathName(LPCTSTR lpszPathName, BOOL bAddToMRU = TRUE);
  28.     //}}AFX_VIRTUAL
  29.  
  30. // Implementation
  31. public:
  32.     HRESULT LoadAlphaBmp(CString& strPath);
  33.     VOID GenerateMipMaps(VOID);
  34.     HRESULT ChangeFormat(LPDIRECT3DBASETEXTURE8 ptexCur, D3DFORMAT fmt, 
  35.                          LPDIRECT3DBASETEXTURE8* pptexNew);
  36.     HRESULT Compress(D3DFORMAT fmt, BOOL bSwitchView);
  37.     DWORD NumMips(VOID);
  38.     LPDIRECT3DBASETEXTURE8 PtexOrig(VOID) { return m_ptexOrig; }
  39.     LPDIRECT3DBASETEXTURE8 PtexNew(VOID) { return m_ptexNew; }
  40.     DWORD DwWidth(VOID) { return m_dwWidth; }
  41.     DWORD DwHeight(VOID) { return m_dwHeight; }
  42.     DWORD DwDepth(VOID) { return m_dwDepth; }
  43.     DWORD DwDepthAt(LONG lwMip);
  44.     BOOL TitleModsChanged(VOID) { return m_bTitleModsChanged; }
  45.     VOID ClearTitleModsChanged(VOID) { m_bTitleModsChanged = FALSE; }
  46.     virtual ~CDxtexDoc();
  47.     void OpenSubsurface(D3DCUBEMAP_FACES FaceType, LONG lwMip, LONG lwSlice);
  48.     void OpenAlphaSubsurface(D3DCUBEMAP_FACES FaceType, LONG lwMip, LONG lwSlice);
  49.     void OpenCubeFace(D3DCUBEMAP_FACES FaceType);
  50.     void OpenAlphaCubeFace(D3DCUBEMAP_FACES FaceType);
  51.     BOOL IsCubeMap(VOID) { return (m_dwCubeMapFlags > 0); }
  52.     BOOL IsVolumeMap(VOID) { return (m_dwDepth > 0); }
  53. #ifdef _DEBUG
  54.     virtual void AssertValid() const;
  55.     virtual void Dump(CDumpContext& dc) const;
  56. #endif
  57.  
  58. // Generated message map functions
  59. protected:
  60.     //{{AFX_MSG(CDxtexDoc)
  61.     afx_msg void OnFileOpenAlpha();
  62.     afx_msg void OnGenerateMipMaps();
  63.     afx_msg void OnFormatDxt1();
  64.     afx_msg void OnFormatDxt2();
  65.     afx_msg void OnFormatDxt3();
  66.     afx_msg void OnFormatDxt4();
  67.     afx_msg void OnFormatDxt5();
  68.     afx_msg void OnFormatChangeCubeMapFaces();
  69.     afx_msg void OnUpdateFileOpenAlpha(CCmdUI* pCmdUI);
  70.     afx_msg void OnUpdateFormatGenerateMipmaps(CCmdUI* pCmdUI);
  71.     afx_msg void OnUpdateFormatChangeCubeMapFaces(CCmdUI* pCmdUI);
  72.     afx_msg void OnFormatMakeIntoVolumeMap();
  73.     afx_msg void OnUpdateFormatMakeIntoVolumeMap(CCmdUI* pCmdUI);
  74.     afx_msg void OnFormatChangeSurfaceFmt();
  75.     //}}AFX_MSG
  76.     DECLARE_MESSAGE_MAP()
  77.  
  78. private:
  79.     LPDIRECT3DBASETEXTURE8 m_ptexOrig;
  80.     LPDIRECT3DBASETEXTURE8 m_ptexNew;
  81.     DWORD m_dwWidth;
  82.     DWORD m_dwHeight;
  83.     DWORD m_dwDepth; // For volume textures
  84.     DWORD m_numMips;
  85.     DWORD m_dwCubeMapFlags;
  86.     BOOL m_bTitleModsChanged;
  87.  
  88.     CDxtexApp* PDxtexApp(VOID) { return (CDxtexApp*)AfxGetApp(); }
  89.     HRESULT LoadAlphaIntoSurface(CString& strPath, LPDIRECT3DSURFACE8 psurf);
  90.     HRESULT LoadVolumeSliceFromSurface(LPDIRECT3DVOLUME8 pVolume, UINT iSlice, LPDIRECT3DSURFACE8 pSurf);
  91.     HRESULT LoadSurfaceFromVolumeSlice(LPDIRECT3DVOLUME8 pVolume, UINT iSlice, LPDIRECT3DSURFACE8 psurf);
  92.     HRESULT BltAllLevels(D3DCUBEMAP_FACES FaceType, LPDIRECT3DBASETEXTURE8 ptexSrc, 
  93.         LPDIRECT3DBASETEXTURE8 ptexDest);
  94.     BOOL PromptForBmp(CString* pstrPath);
  95.     D3DFORMAT GetFormat(LPDIRECT3DBASETEXTURE8 ptex);
  96.     HRESULT EnsureAlpha(LPDIRECT3DBASETEXTURE8* pptex);
  97. };
  98.  
  99. /////////////////////////////////////////////////////////////////////////////
  100.  
  101. //{{AFX_INSERT_LOCATION}}
  102. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  103.  
  104. #endif // !defined(AFX_DXTXDOC_H__712C53CF_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_)
  105.